import request from '@/utils/request'
import { websock } from '@/websock'

export function login(data) {
  return request({
    url: '/oa/login',
    method: 'post',
    data
  })
}

// 发送短信验证码
export function sendSmsCode(data) {
	return request({
		url: '/oa/sendsmscode',
		method:"post",
		data
	})
}

// 重置密码
export function resetPwd(data) {
	return request({
		url: '/oa/resetPwd',
		method:"post",
		data
	})
}

export function getInfo() {
  console.log('api-admin-getinfo')
  return websock.getUserInfo()
  // return request({
  //   url: '/admin/info',
  //   method: 'get'
  // })
}

export function logout() {
  return request({
    url: '/admin/logout',
    method: 'post'
  })
}

export function GetNewToken(params) {
  return request({
    url: '/common/login/southLogin',
    method: 'post',
    params,
    jy: true
  })
}
